﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace Stopwatch {
    class Laptime {
        public Laptime(TimeSpan elapsed, Laptime prev) {
            if (prev == null) {
                this.Nr = 1;
                this.Lap = elapsed;
                this.Total = elapsed;
            } else {
                this.Nr = prev.Nr + 1;
                this.Lap = elapsed - prev.Total;
                this.Total = elapsed;
            }
        }

        public int Nr;
        public TimeSpan Lap;
        public TimeSpan Total;
    }
}
